package com.shangxia.monomer.common.util;

import lombok.extern.slf4j.Slf4j;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.TemporalAdjuster;
import java.time.temporal.TemporalAdjusters;
import java.time.temporal.TemporalField;

import static java.time.temporal.IsoFields.DAY_OF_QUARTER;
import static java.time.temporal.IsoFields.QUARTER_OF_YEAR;

/**
 * @ProjectName: monomer
 * @ClassName: DateUtil
 * @Time: 2021/9/26
 * @Author: zhouy
 * @Description:
 * @Experience:
 */

@Slf4j
public class DateUtil {

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now);
        System.out.println(now.getMonth());
        System.out.println(now.getYear());
        System.out.println(now.getHour());
        System.out.println(now.getSecond());
        LocalDate localDate = now.toLocalDate();
        System.out.println(localDate.get(QUARTER_OF_YEAR));

        System.out.println(localDate);

    }

}
